#include <cmath>

#include "water.h"
#include "common.h"

Water::Water(const double wavePeriod)
: wavePeriod(wavePeriod)
{
	double waveAmplitude = wavePeriod * wavePeriod / 46.08;
	double a = waveAmplitude * 2 / sqrt(5.0);
	double b = 0.5 * a;
	
	waveFrequency = 2.0 * PI / wavePeriod;

	double K = waveFrequency * waveFrequency / G;

	waveAngleAmplitude = sqrt(a*a*K*K + b*b*K*K);
	waveVelocity = G / waveFrequency;
	waveLength = G * wavePeriod * wavePeriod / 2.0 / PI;
}